<?php
namespace app\m\controller;

use app\common\controller\HomeBase;
use think\Db;
use app\common\model\User as UserModel;
use think\facade\Cache;
use think\facade\Config;
use think\facade\Session;
use think\facade\Url;

class User extends HomeBase
{
    protected function initialize()
    {
        parent::initialize();
        $this->checkLogin();

    }

    public function index()
    {
        $this->site_seo("home");

        $vip = model('vip')->where(['id' => $this->user_info['vip_id']])->find();
        $this->site_seo("home");
        return $this->fetch('index',['index_style' => 'user','vip' => $vip]);
    }


    /**
     * 退出
     * @return mixed
     */
    public function logout()
    {
        Session::set('user_info', "");
        $this->success("退出成功");
    }
}
